package com.example.paper.http.logUtils;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;


public class GlideManager {

    private static GlideManager glideManager;

    public static GlideManager getInstance() {
        if (glideManager == null) {
            glideManager = new GlideManager();
        }
        return glideManager;
    }

    public void GildeNorImage(ImageView imageView, Context context, String path) {
        Glide.with(context).load(path).into(imageView);
    }

    public void GildeCirImage(ImageView imageView, Context context, String path) {
        Glide.with(context).load(path).transform(new CircleCrop()).into(imageView);
    }

    public void GildeCirJaoImage(ImageView imageView, Context context, String path) {
        Glide.with(context).load(path).transform(new CenterCrop(), new RoundedCorners(5)).into(imageView);
    }
}
